package com.qing.utils.lottery.ssq;

import cn.hutool.http.ContentType;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;
import com.qing.utils.lottery.ssq.bean.SsqResponse;
import com.qing.utils.lottery.ssq.bean.SsqResponseResult;

import java.util.List;

public class ZcwSsqQueryUtil {
//

    private static List<SsqResponseResult> querySsqWinningList(int count) {
//        String ssqQueryUrl = "http://www.cwl.gov.cn/cwl_admin/front/cwlkj/search/kjxx/findDrawNotice?name=ssq&issueCount=30&issueStart=&issueEnd=&dayStart=&dayEnd=";
        String ssqQueryUrl = "https://jc.zhcw.com/port/client_json.php?callback=jQuery112203309370653671926_1692437776268&transactionType=10001001&lotteryId=1&issueCount=1000&startIssue=&endIssue=&startDate=&endDate=&type=0&pageNum=1&pageSize=30&tt=0.31727756518270267&_=1692437776273";
        String s = HttpUtil.get(ssqQueryUrl);
        HttpRequest httpRequest = HttpUtil.createGet(ssqQueryUrl).contentType(ContentType.JSON.getValue());
        System.out.println("============双色球");
        String body;
        try (HttpResponse response = httpRequest.execute()) {
            body = response.body();
            System.out.println(body);
            System.out.println("============双色球");
            SsqResponse ssqResponse = JSONUtil.toBean(body, SsqResponse.class);
            return ssqResponse.getResult();
        }
    }
}
